package org.rency.ues.engine.validator;

import org.rency.ues.common.UesDict;
import org.rency.ues.common.enums.EncryptType;
import org.rency.ues.domain.request.SignRequest;
import org.rency.ues.domain.response.SignResponse;
import org.springframework.util.Assert;

/**
 * 加签校验器
 *
 * @author: Created by user_rcy@163.com on 2016/08/02.
 * @version: V1.0.0
 * @since JDK 1.8
 */
public class SignValidator extends AbstractRequestValidator<SignRequest, SignResponse>{
    @Override
    protected void validate(SignRequest request) {
        Assert.isTrue(EncryptType.RSA == request.getEncryptType(),String.format(UesDict.CHINESE_NOT_SUPPORT_ENCRYPT_TYPE_MSG,request.getEncryptType().getCode()));
    }

    @Override
    protected String getValidatorName() {
        return "加签";
    }

    @Override
    protected SignResponse success() {
        return null;
    }

    @Override
    protected SignResponse fail(String returnMessage) {
        return null;
    }
}
